package com.ruanyun.modular.ry.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruanyun.modular.ry.api.vo.resp.AddressRespVo;
import com.ruanyun.modular.ry.entity.Address;
import com.ruanyun.modular.ry.model.params.AddressParam;
import com.ruanyun.modular.ry.model.result.AddressResult;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 地址表 Mapper 接口
 * </p>
 *
 * @author conan
 * @since 2020-12-02
 */
@Repository
public interface AddressMapper extends BaseMapper<Address> {

    /**
     * 获取列表
     *
     * @author conan
     * @Date 2020-12-02
     */
    List<AddressResult> customList(@Param("paramCondition") AddressParam paramCondition);

    /**
     * 获取map列表
     *
     * @author conan
     * @Date 2020-12-02
     */
    List<Map<String, Object>> customMapList(@Param("paramCondition") AddressParam paramCondition);

    /**
     * 获取分页实体列表
     *
     * @author conan
     * @Date 2020-12-02
     */
    Page<AddressResult> customPageList(@Param("page") Page page, @Param("paramCondition") AddressParam paramCondition);

    /**
     * 获取分页map列表
     *
     * @author conan
     * @Date 2020-12-02
     */
    Page<Map<String, Object>> customPageMapList(@Param("page") Page page, @Param("paramCondition") AddressParam paramCondition);

    /**
     * 用户地址管理
     *
     * @param page
     * @param customerId
     * @return
     */
    Page<AddressRespVo> findPage(@Param("page") Page page, @Param("customerId") Long customerId);
}
